package com.design.demo.observer;

import java.util.Observable;
import java.util.Observer;

/**
 * @author guoliang.li
 * @date 2019/12/27 17:21
 * @description TODO 订阅
 */
public class Subscribe implements Observer {

    public Subscribe(Observable o) {
        o.addObserver(this);
    }

    @Override
    public void update(Observable o, Object arg) {

        System.out.println("===>" + ((Publish) o).getData());
    }
}
